package com.wing.cabinet.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.cabinet.model.entity.CellInventorySpace;
import com.wing.cabinet.model.request.CellInventorySpaceForm;
import com.wing.cabinet.model.request.UseInventoryInoutDetailForm;
import com.wing.cabinet.model.response.CabOptimalSpaces;
import com.wing.cabinet.model.response.CellInventorySpaceVO;
import com.wing.cabinet.model.response.OldNewSpaceVO;
import com.wing.cabinet.model.response.SpacesResultVO;
import com.wing.common.utils.JsonResult;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 售刀柜产品货道库存-Service
 *
 * @author
 */
public interface CellInventorySpaceService extends IService<CellInventorySpace> {

    /**
     * 添加
     *
     * @param cellInventorySpaceForm
     * @return
     */
    int add(CellInventorySpaceForm cellInventorySpaceForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<CellInventorySpaceVO> list4app(Map<String, Object> params);

    List<CellInventorySpaceVO> listSKU4app(Map<String, Object> params);

    List<CellInventorySpaceVO> listOptimalSpace4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<CellInventorySpaceVO> pageList4app(Page page, Map<String, Object> params);
    Page<CellInventorySpaceVO> pageListSKU4app(Page page, Map<String, Object> params);
    Page<CellInventorySpaceVO> pageList(Page page, Map<String, Object> params);

    JsonResult<List<CellInventorySpaceVO>> getSpaces(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    JsonResult<OldNewSpaceVO> getSpaces4MoreKnife(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    JsonResult<OldNewSpaceVO> getUserSpaces(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    JsonResult<OldNewSpaceVO> getUserSpaces4MoreKnife(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    List<UseInventoryInoutDetailForm> getOptimalSpaces(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    List<CabOptimalSpaces> getCabOptimalSpaces(UseInventoryInoutDetailForm useInventoryInoutDetailForm);


    SpacesResultVO getCabOptimalLanesSpaces(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    CellInventorySpaceVO get4appById(Long id);

    /**
     * 报警产品
     *
     * @param listRecords 列表记录
     * @return {@link CellInventorySpaceVO}
     */
    List<CellInventorySpaceVO> getAlarmProduct(List<CellInventorySpaceVO> listRecords);

    /**
     * 导出按货道库存数据
     * @return
     */
    List<CellInventorySpaceVO> ecxportList(Map<String, Object> params);

    /**
     * 根据条件查询统计库存数
     * @param mainCabCode
     * @param cabCode
     * @param skuCode
     * @return
     */
    Integer getSumByParams(String mainCabCode,String cabCode,String skuCode);
}
